package com.itmk.web.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.itmk.web.goods.entity.Goods;
import com.itmk.web.goods_order.entity.MyOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {

    //查询我的订单
    IPage<MyOrder> getMyOrder(IPage<MyOrder> page, @Param("userId") Long userId);
    //查询出售订单
    IPage<MyOrder> getSellOrder(IPage<MyOrder> page, @Param("userId") Long userId);

    @Select("select goods_id from max_id where id = 1;")
    Long maxId();

    @Update("update max_id set goods_id = #{l} where id = 1")
    void updateMaxId(long l);
}
